package com.ibuonline.b2b.entity;

import java.io.Serializable;

public class CompanyToCategory implements Serializable {

	private static final long serialVersionUID = 7296864506021889209L;

	//fields
	private java.lang.Integer companyId;
	private java.lang.Integer catId;

	//default constructor
	public CompanyToCategory() {
	}

	//constructor with arguments
	public CompanyToCategory(java.lang.Integer catId, java.lang.Integer companyId) {
		this.catId = catId;
		this.companyId = companyId;
	}

	//getter
	public java.lang.Integer getCompanyId() {
		return companyId;
	}
	public java.lang.Integer getCatId() {
		return catId;
	}

	//setter
	public void setCompanyId(java.lang.Integer companyId) {
		this.companyId = companyId;
	}
	public void setCatId(java.lang.Integer catId) {
		this.catId = catId;
	}

	//equals method
	public boolean equals(Object other) {
		if (this == other)
			return true;
		if (!(other instanceof CompanyToCategory))
			return false;

		final CompanyToCategory companyToCategory = (CompanyToCategory)other;
		if (!this.catId.equals(companyToCategory.getCatId()) || 
			!this.companyId.equals(companyToCategory.getCompanyId()))
			return false;

		return true;
	}

	//hashCode method
	public int hashCode() {
		StringBuffer keys = new StringBuffer();
		keys.append(catId).append(",");
		keys.append(companyId).append(",");
		if (keys.length() > 0)
			keys.deleteCharAt(keys.length() - 1);
		return keys.toString().hashCode();
	}

	//toString method
	public String toString() {
		return new StringBuilder("CompanyToCategory[")
			.append("companyId=").append(companyId).append(", ")
			.append("catId=").append(catId).append("]").toString();
	}
}